<html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>星星特效 </title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        div {
            line-height: 35px;
        }

        li {
            width: 50px;
            height: 100px;
            background: url(star_fill.png) no-repeat;
            float: left;
            list-style: none;
            margin: 5px;
            cursor: pointer;
        }

        s {
            color: rgb(162, 168, 108);
        }
    </style>
</head>

<body>
    <div>
        <button class="btn">想看</button>
        <button class="btn">看过</button>
    </div>

    <div>评价：</div>
    <div>
        <ul>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
        <span></span>
        <div>推荐</div>
    </div>
</body>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.3/jquery.js"></script>
<script>
    var oldTndex = -1;
    $("li").mouseover(function () {
        clearTimeout(timer);
        var index = $(this).index();
        $("li").slice(0, index + 1).css("background-image", "url(star_fill.png)");
        $("li").slice(index + 1).css("background-image", "url(star.png)");
    })
        .mouseout(function () {
            timer = setTimeout(function () {
                $("li").slice(0, oldTndex + 1).css("background-image", "url(star_fill.png)");
                $("li").slice(index + 1).css("background-image", "url(star.png)");
            }, 200);
        });

    $(".btn").css({
        "background": "rgb(162, 168, 108)",
        "width": "70px",
        "height": "40px",
        "font-size": "10px",
        "color": "white",
        "border": "0",
    })
</script>

</html>